﻿using UnityEngine;
using System.Collections;

public class Enemy : MonoBehaviour
{

    

    #region GameCore
    // Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {

    }
    #endregion


    #region Make Animations

    void MakeAnimations(int type)
    {
        switch (type){
            case 1:
                MakeAnimationsType1();
                break;
            case 2:
                MakeAnimationsType2();
                break;
        }
    }

    /// <summary>
    /// Make animations for car type 1.
    /// car will move to main player
    /// </summary>
    void MakeAnimationsType1()
    {
        Vector3 currentPos = gameObject.transform.position;

        float lerpStep = 2.0f;

        gameObject.transform.position = new Vector3(currentPos.x - (lerpStep * Time.deltaTime), currentPos.y, currentPos.z);

    }

    /// <summary>
    /// Make animations for car type 2
    /// car will move opposite to the main player
    /// </summary>
    void MakeAnimationsType2()
    {
        Vector3 currentPos = gameObject.transform.position;

        float lerpStep = 2.0f;

        gameObject.transform.position = new Vector3(currentPos.x + (lerpStep * Time.deltaTime), currentPos.y, currentPos.z);
    }
    
    #endregion


    #region Collision

    /// <summary>
    /// On collision, main car will make bound
    /// </summary>
    /// <param name="other"></param>
    void OnEnterCollision2D(Collider other)
    {

    }

    #endregion

}
